/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'central';
  
  checkConfig(config);
  @endpoint = getEndpoint('pts', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AdjustJMeterSceneSpeedRequest {
  reportId?: string(name='ReportId', example='DYYPZIH'),
  speed?: int32(name='Speed', example='100'),
}

model AdjustJMeterSceneSpeedResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message', example='success'),
  reportId?: string(name='ReportId', example='DYYPZIH'),
  requestId?: string(name='RequestId', example='DC4E31DDA77-6745-4925-B423-4E89VV34221A'),
  success?: boolean(name='Success', example='true'),
}

model AdjustJMeterSceneSpeedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AdjustJMeterSceneSpeedResponseBody(name='body'),
}

async function adjustJMeterSceneSpeedWithOptions(request: AdjustJMeterSceneSpeedRequest, runtime: Util.RuntimeOptions): AdjustJMeterSceneSpeedResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.speed)) {
    query['Speed'] = request.speed;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AdjustJMeterSceneSpeed',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function adjustJMeterSceneSpeed(request: AdjustJMeterSceneSpeedRequest): AdjustJMeterSceneSpeedResponse {
  var runtime = new Util.RuntimeOptions{};
  return adjustJMeterSceneSpeedWithOptions(request, runtime);
}

model AdjustPtsSceneSpeedRequest {
  apiSpeedList?: [ 
    {
      apiId?: string(name='ApiId', example='DYXXX12H'),
      speed?: long(name='Speed', example='30'),
    }
  ](name='ApiSpeedList'),
  sceneId?: string(name='SceneId', example='DYXXX12H'),
}

model AdjustPtsSceneSpeedShrinkRequest {
  apiSpeedListShrink?: string(name='ApiSpeedList'),
  sceneId?: string(name='SceneId', example='DYXXX12H'),
}

model AdjustPtsSceneSpeedResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2CE0-XXXX-4143-955A-8E4595AF86A6'),
  success?: boolean(name='Success', example='true'),
}

model AdjustPtsSceneSpeedResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AdjustPtsSceneSpeedResponseBody(name='body'),
}

async function adjustPtsSceneSpeedWithOptions(tmpReq: AdjustPtsSceneSpeedRequest, runtime: Util.RuntimeOptions): AdjustPtsSceneSpeedResponse {
  Util.validateModel(tmpReq);
  var request = new AdjustPtsSceneSpeedShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.apiSpeedList)) {
    request.apiSpeedListShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.apiSpeedList, 'ApiSpeedList', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.apiSpeedListShrink)) {
    query['ApiSpeedList'] = request.apiSpeedListShrink;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AdjustPtsSceneSpeed',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function adjustPtsSceneSpeed(request: AdjustPtsSceneSpeedRequest): AdjustPtsSceneSpeedResponse {
  var runtime = new Util.RuntimeOptions{};
  return adjustPtsSceneSpeedWithOptions(request, runtime);
}

model CreatePtsSceneRequest {
  scene?: string(name='Scene'),
}

model CreatePtsSceneResponseBody = {
  code?: string(name='Code', example='4001'),
  httpStatusCode?: int32(name='HttpStatusCode', example='400'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2CE0-AE4C-4143-955A-8E4595AF86A6'),
  sceneId?: string(name='SceneId', example='SDR3CX'),
  success?: boolean(name='Success', example='false'),
}

model CreatePtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePtsSceneResponseBody(name='body'),
}

async function createPtsSceneWithOptions(request: CreatePtsSceneRequest, runtime: Util.RuntimeOptions): CreatePtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.scene)) {
    query['Scene'] = request.scene;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPtsScene(request: CreatePtsSceneRequest): CreatePtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPtsSceneWithOptions(request, runtime);
}

model CreatePtsSceneBaseLineFromReportRequest {
  reportId?: string(name='ReportId', example='HNB78HB'),
  sceneId?: string(name='SceneId', example='VCB78HB'),
}

model CreatePtsSceneBaseLineFromReportResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2CE0-AE4C-4143-954A-8E4595AF86A6'),
  success?: boolean(name='Success', example='true'),
}

model CreatePtsSceneBaseLineFromReportResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePtsSceneBaseLineFromReportResponseBody(name='body'),
}

async function createPtsSceneBaseLineFromReportWithOptions(request: CreatePtsSceneBaseLineFromReportRequest, runtime: Util.RuntimeOptions): CreatePtsSceneBaseLineFromReportResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreatePtsSceneBaseLineFromReport',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createPtsSceneBaseLineFromReport(request: CreatePtsSceneBaseLineFromReportRequest): CreatePtsSceneBaseLineFromReportResponse {
  var runtime = new Util.RuntimeOptions{};
  return createPtsSceneBaseLineFromReportWithOptions(request, runtime);
}

model DeletePtsSceneRequest {
  sceneId?: string(name='SceneId', example='XANH3H'),
}

model DeletePtsSceneResponseBody = {
  code?: string(name='Code', example='4001'),
  httpStatusCode?: int32(name='HttpStatusCode', example='400'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A3ED870E-C3BF-44F4-B460-A30785E0256B'),
  success?: boolean(name='Success', example='false'),
}

model DeletePtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePtsSceneResponseBody(name='body'),
}

async function deletePtsSceneWithOptions(request: DeletePtsSceneRequest, runtime: Util.RuntimeOptions): DeletePtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePtsScene(request: DeletePtsSceneRequest): DeletePtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePtsSceneWithOptions(request, runtime);
}

model DeletePtsSceneBaseLineRequest {
  sceneId?: string(name='SceneId', example='NHGV4CDG'),
}

model DeletePtsSceneBaseLineResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2XE0-AE4C-4143-955A-8E4595AF86A6'),
  success?: boolean(name='Success', example='true'),
}

model DeletePtsSceneBaseLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePtsSceneBaseLineResponseBody(name='body'),
}

async function deletePtsSceneBaseLineWithOptions(request: DeletePtsSceneBaseLineRequest, runtime: Util.RuntimeOptions): DeletePtsSceneBaseLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePtsSceneBaseLine',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePtsSceneBaseLine(request: DeletePtsSceneBaseLineRequest): DeletePtsSceneBaseLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePtsSceneBaseLineWithOptions(request, runtime);
}

model DeletePtsScenesRequest {
  sceneIds?: [ string ](name='SceneIds', example='["XVB4DF","AFG3CV"]'),
}

model DeletePtsScenesShrinkRequest {
  sceneIdsShrink?: string(name='SceneIds', example='["XVB4DF","AFG3CV"]'),
}

model DeletePtsScenesResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='35290A5B-AB50-46BD-81E0-E316F86128C4'),
  success?: boolean(name='Success', example='true'),
}

model DeletePtsScenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePtsScenesResponseBody(name='body'),
}

async function deletePtsScenesWithOptions(tmpReq: DeletePtsScenesRequest, runtime: Util.RuntimeOptions): DeletePtsScenesResponse {
  Util.validateModel(tmpReq);
  var request = new DeletePtsScenesShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.sceneIds)) {
    request.sceneIdsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sceneIds, 'SceneIds', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.sceneIdsShrink)) {
    query['SceneIds'] = request.sceneIdsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeletePtsScenes',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deletePtsScenes(request: DeletePtsScenesRequest): DeletePtsScenesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deletePtsScenesWithOptions(request, runtime);
}

model GetAllRegionsResponseBody = {
  allRegions?: map[string]string(name='AllRegions'),
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='73D16B8D-0FCD-5596-B7BE-A47042989318'),
  success?: boolean(name='Success', example='True'),
}

model GetAllRegionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetAllRegionsResponseBody(name='body'),
}

async function getAllRegionsWithOptions(runtime: Util.RuntimeOptions): GetAllRegionsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetAllRegions',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAllRegions(): GetAllRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAllRegionsWithOptions(runtime);
}

model GetJMeterLogsRequest {
  agentIndex?: int32(name='AgentIndex', example='0'),
  beginTime?: long(name='BeginTime', example='1637115306000'),
  endTime?: long(name='EndTime', example='1637115309000'),
  keyword?: string(name='Keyword', example='test'),
  level?: string(name='Level', example='INFO'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reportId?: string(name='ReportId', example='KS2YE3J2'),
  thread?: string(name='Thread', example='main'),
}

model GetJMeterLogsResponseBody = {
  agentCount?: int32(name='AgentCount', example='3'),
  code?: string(name='Code', example='200'),
  logs?: [  map[string]any ](name='Logs', example='{ "timeTS":1637114804326, "instanceId":0, "level":"INFO", "logger":"org.apache.jmeter.util.JMeterUtils", "sceneId":251546, 	"planId":1501546, "thread":"main", "time":"2021-11-17T10:06Z", "taskId":15015460000, "logText":"Setting Locale to en_EN\\n" }'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model GetJMeterLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJMeterLogsResponseBody(name='body'),
}

async function getJMeterLogsWithOptions(request: GetJMeterLogsRequest, runtime: Util.RuntimeOptions): GetJMeterLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentIndex)) {
    query['AgentIndex'] = request.agentIndex;
  }
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.level)) {
    query['Level'] = request.level;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.thread)) {
    query['Thread'] = request.thread;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJMeterLogs',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJMeterLogs(request: GetJMeterLogsRequest): GetJMeterLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJMeterLogsWithOptions(request, runtime);
}

model GetJMeterReportDetailsRequest {
  reportId?: string(name='ReportId', example='KS2YE3J2'),
}

model GetJMeterReportDetailsResponseBody = {
  code?: string(name='Code', example='4001'),
  codeKey?: string(name='CodeKey'),
  documentUrl?: string(name='DocumentUrl'),
  dynamicCtx?: string(name='DynamicCtx'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  reportOverView?: {
    agentCount?: int32(name='AgentCount', example='1'),
    endTime?: string(name='EndTime', example='2023-05-03 10:45:11'),
    reportId?: string(name='ReportId', example='GHB56VD'),
    reportName?: string(name='ReportName'),
    startTime?: string(name='StartTime', example='2023-05-03 10:35:11'),
    vum?: long(name='Vum', example='4452'),
  }(name='ReportOverView'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  samplerMetricsList?: [ 
    {
      allCount?: long(name='AllCount', example='731'),
      apiName?: string(name='ApiName'),
      avgRt?: double(name='AvgRt', example='44.2'),
      avgTps?: double(name='AvgTps', example='12'),
      failCountReq?: long(name='FailCountReq', example='10'),
      maxRt?: double(name='MaxRt', example='78'),
      minRt?: double(name='MinRt', example='11'),
      seg75Rt?: double(name='Seg75Rt', example='22.4'),
      seg90Rt?: double(name='Seg90Rt', example='65'),
      seg99Rt?: double(name='Seg99Rt', example='77'),
      successRateReq?: double(name='SuccessRateReq', example='100'),
    }
  ](name='SamplerMetricsList'),
  sceneMetrics?: {
    allCount?: long(name='AllCount', example='717'),
    avgRt?: double(name='AvgRt', example='23'),
    avgTps?: double(name='AvgTps', example='78'),
    failCountReq?: long(name='FailCountReq', example='34'),
    seg90Rt?: double(name='Seg90Rt', example='35'),
    seg99Rt?: double(name='Seg99Rt', example='56'),
    successRateReq?: double(name='SuccessRateReq', example='0.99'),
  }(name='SceneMetrics'),
  success?: boolean(name='Success', example='true'),
}

model GetJMeterReportDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJMeterReportDetailsResponseBody(name='body'),
}

async function getJMeterReportDetailsWithOptions(request: GetJMeterReportDetailsRequest, runtime: Util.RuntimeOptions): GetJMeterReportDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJMeterReportDetails',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJMeterReportDetails(request: GetJMeterReportDetailsRequest): GetJMeterReportDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJMeterReportDetailsWithOptions(request, runtime);
}

model GetJMeterSampleMetricsRequest {
  beginTime?: long(name='BeginTime', example='1637157070000'),
  endTime?: long(name='EndTime', example='1637157073000'),
  reportId?: string(name='ReportId', example='7R4RE352'),
  samplerId?: int32(name='SamplerId', example='0'),
}

model GetJMeterSampleMetricsResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  sampleMetricList?: [ string ](name='SampleMetricList'),
  samplerMap?: map[string]any(name='SamplerMap', example='{0:"Http Request"}'),
  success?: boolean(name='Success', example='true'),
}

model GetJMeterSampleMetricsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJMeterSampleMetricsResponseBody(name='body'),
}

async function getJMeterSampleMetricsWithOptions(request: GetJMeterSampleMetricsRequest, runtime: Util.RuntimeOptions): GetJMeterSampleMetricsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.samplerId)) {
    query['SamplerId'] = request.samplerId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJMeterSampleMetrics',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJMeterSampleMetrics(request: GetJMeterSampleMetricsRequest): GetJMeterSampleMetricsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJMeterSampleMetricsWithOptions(request, runtime);
}

model GetJMeterSamplingLogsRequest {
  agentId?: long(name='AgentId', example='14238000'),
  beginTime?: long(name='BeginTime', example='1637157073000'),
  endTime?: long(name='EndTime', example='1637157076000'),
  keyword?: string(name='Keyword', example='test'),
  maxRT?: int32(name='MaxRT', example='1000'),
  minRT?: int32(name='MinRT', example='0'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reportId?: string(name='ReportId', example='7R4RE352'),
  responseCode?: string(name='ResponseCode', example='200'),
  samplerId?: int32(name='SamplerId', example='0'),
  success?: boolean(name='Success', example='true'),
  thread?: string(name='Thread', example='main'),
}

model GetJMeterSamplingLogsResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  sampleResults?: [ string ](name='SampleResults'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model GetJMeterSamplingLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJMeterSamplingLogsResponseBody(name='body'),
}

async function getJMeterSamplingLogsWithOptions(request: GetJMeterSamplingLogsRequest, runtime: Util.RuntimeOptions): GetJMeterSamplingLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.agentId)) {
    query['AgentId'] = request.agentId;
  }
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.maxRT)) {
    query['MaxRT'] = request.maxRT;
  }
  if (!Util.isUnset(request.minRT)) {
    query['MinRT'] = request.minRT;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.responseCode)) {
    query['ResponseCode'] = request.responseCode;
  }
  if (!Util.isUnset(request.samplerId)) {
    query['SamplerId'] = request.samplerId;
  }
  if (!Util.isUnset(request.success)) {
    query['Success'] = request.success;
  }
  if (!Util.isUnset(request.thread)) {
    query['Thread'] = request.thread;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJMeterSamplingLogs',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJMeterSamplingLogs(request: GetJMeterSamplingLogsRequest): GetJMeterSamplingLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJMeterSamplingLogsWithOptions(request, runtime);
}

model GetJMeterSceneRunningDataRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model GetJMeterSceneRunningDataResponseBody = {
  code?: string(name='Code', example='200'),
  documentUrl?: string(name='DocumentUrl'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  runningData?: {
    agentCount?: int32(name='AgentCount', example='2'),
    agentIdList?: [ string ](name='AgentIdList'),
    allSampleStat?: map[string]any(name='AllSampleStat', example='{ "failTps":0,"successRtAvg":33,"successRtMin":29,"successRtSum":99407,         "rtAvg":33.459104678559406,"rtMin":29,"failRtMax":0,"duration":997,         "samplerId":-1, "successRtMax":133,"fullStat":{       "requestBytesSum":629926,"successRtAvg":33,"successRtMin":29,"successRtSum":174551,"count":5206,"rtSeg99":53, "successTps":2397.9732842008293,"rtSeg90":36, "rtSeg50":32,            "rtSeg99Sum":53,"rtAvg":33.528812908182864, "rtMin":29,             "failRtMax":0,"duration":2171, "successCount":5206,            "rtSegStatCount":1,"tps":2397.9732842008293 }, "successCount":2971, "failRtSum":0,"failCount":0,"count":2971,"concurrency":100, "successTps":2979.939819458375,"tps":2979.939819458375,"failRtAvg":0,         "failRtMin":0,  "rtMax":133}'),
    concurrency?: int32(name='Concurrency', example='1000'),
    errorMessage?: string(name='ErrorMessage', example='引擎租用失败'),
    hasError?: boolean(name='HasError', example='false'),
    hasReport?: boolean(name='HasReport', example='false'),
    holdFor?: int32(name='HoldFor', example='600'),
    isDebugging?: boolean(name='IsDebugging', example='false'),
    reportId?: string(name='ReportId', example='DYYPLDKS'),
    sampleStatList?: [  map[string]any ](name='SampleStatList'),
    sceneId?: string(name='SceneId', example='DYYPZIH'),
    sceneName?: string(name='SceneName', example='test'),
    stageName?: string(name='StageName', example='任务执行'),
    startTimeTS?: long(name='StartTimeTS', example='1639970040000'),
    status?: string(name='Status', example='RUNNING'),
    vum?: long(name='Vum', example='100'),
  }(name='RunningData'),
  success?: boolean(name='Success', example='true'),
}

model GetJMeterSceneRunningDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetJMeterSceneRunningDataResponseBody(name='body'),
}

async function getJMeterSceneRunningDataWithOptions(request: GetJMeterSceneRunningDataRequest, runtime: Util.RuntimeOptions): GetJMeterSceneRunningDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetJMeterSceneRunningData',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getJMeterSceneRunningData(request: GetJMeterSceneRunningDataRequest): GetJMeterSceneRunningDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getJMeterSceneRunningDataWithOptions(request, runtime);
}

model GetOpenJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model GetOpenJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  scene?: {
    agentCount?: int32(name='AgentCount', example='2'),
    baseInfo?: {
      createName?: string(name='CreateName', example='张三'),
      modifyName?: string(name='ModifyName', example='里斯'),
      operateType?: string(name='OperateType', example='保存去压测'),
      principal?: string(name='Principal', example='test-person'),
      remark?: string(name='Remark', example='小心压测'),
      resource?: string(name='Resource', example='create'),
    }(name='BaseInfo'),
    concurrency?: int32(name='Concurrency', example='1000'),
    constantThroughputTimerType?: string(name='ConstantThroughputTimerType', example='STAND_ALONE'),
    dnsCacheConfig?: {
      clearCacheEachIteration?: boolean(name='ClearCacheEachIteration', example='false'),
      dnsServers?: [ string ](name='DnsServers'),
      hostTable?: map[string]any(name='HostTable', example='{"server.com":"6.6.6.6"}'),
    }(name='DnsCacheConfig'),
    duration?: int32(name='Duration', example='600'),
    environmentId?: string(name='EnvironmentId', example='EEDT7'),
    fileList?: [ 
      {
        fileName?: string(name='FileName', example='json.jar'),
        fileOssAddress?: string(name='FileOssAddress', example='https://test.oss-cn-shanghai.aliyuncs.com/json.jar'),
        fileSize?: long(name='FileSize', example='700'),
        fileType?: string(name='FileType', example='jar'),
        id?: long(name='Id', example='61660'),
        md5?: string(name='Md5', example='43B584026CE5E570F3DE638FA7EEF9E0'),
        splitCsv?: boolean(name='SplitCsv', example='false'),
      }
    ](name='FileList'),
    isVpcTest?: boolean(name='IsVpcTest', example='false'),
    maxRps?: int32(name='MaxRps', example='true'),
    mode?: string(name='Mode', example='concurrency_mode'),
    pool?: string(name='Pool', example='VPC'),
    rampUp?: int32(name='RampUp', example='100'),
    regionId?: string(name='RegionId', example='cn-beijing'),
    regionalCondition?: [ 
      {
        amount?: int32(name='Amount'),
        region?: string(name='Region'),
      }
    ](name='RegionalCondition'),
    sceneId?: string(name='SceneId', example='DYYPZIH'),
    sceneName?: string(name='SceneName', example='test'),
    securityGroupId?: string(name='SecurityGroupId', example='sg-2zeid0dd7bhahsgdahspaly'),
    startConcurrency?: int32(name='StartConcurrency', example='true'),
    startRps?: int32(name='StartRps', example='true'),
    steps?: int32(name='Steps', example='3'),
    syncTimerType?: string(name='SyncTimerType', example='GLOBAL'),
    testFile?: string(name='TestFile', example='baidu.jmx'),
    vSwitchId?: string(name='VSwitchId', example='vsw-2zehsgdhsahw1r'),
    vpcId?: string(name='VpcId', example='vpc-2ze2sahjdgahsebjkqhf4pyj'),
  }(name='Scene'),
  success?: boolean(name='Success', example='true'),
}

model GetOpenJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetOpenJMeterSceneResponseBody(name='body'),
}

async function getOpenJMeterSceneWithOptions(request: GetOpenJMeterSceneRequest, runtime: Util.RuntimeOptions): GetOpenJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetOpenJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getOpenJMeterScene(request: GetOpenJMeterSceneRequest): GetOpenJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return getOpenJMeterSceneWithOptions(request, runtime);
}

model GetPtsDebugSampleLogsRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  planId?: string(name='PlanId', example='NJJBH8B'),
}

model GetPtsDebugSampleLogsResponseBody = {
  code?: string(name='Code', example='4001'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  samplingLogs?: [ 
    {
      chainId?: string(name='ChainId', example='65354719'),
      chainName?: string(name='ChainName'),
      checkResult?: string(name='CheckResult'),
      exportConfig?: string(name='ExportConfig', example='{\\"skuId\\":\\"{R:json@$.page.list[0].skuId}\\"}'),
      exportContent?: string(name='ExportContent', example='{"skuId":"1"}'),
      httpRequestBody?: string(name='HttpRequestBody', example='{"loginacct":"acce"}'),
      httpRequestHeaders?: string(name='HttpRequestHeaders', example='[{"name":"v2","sensitive":false,"value":"1"},{"name":"x-pts-test","sensitive":false,"value":"2"}]'),
      httpRequestMethod?: string(name='HttpRequestMethod', example='GET'),
      httpRequestUrl?: string(name='HttpRequestUrl', example='http://www.example.com'),
      httpResponseBody?: string(name='HttpResponseBody', example='{"timestamp":1679903049155,"status":404,"error":"Not Found","message":"No message available","path":"/"}'),
      httpResponseFailMsg?: string(name='HttpResponseFailMsg', example='""'),
      httpResponseHeaders?: string(name='HttpResponseHeaders', example='[{"valuePos":18,"name":"transfer-encoding","buffer":{"empty":false,"full":false},"sensitive":false,"value":"chunked"},{"valuePos":13,"name":"Content-Type","buffer":{"empty":false,"full":false},"sensitive":false,"value":"application/json;charset=UTF-8"},{"valuePos":5,"name":"Date","buffer":{"empty":false,"full":false},"sensitive":false,"value":"Mon, 27 Mar 2023 07:44:08 GMT"}]'),
      httpResponseStatus?: string(name='HttpResponseStatus', example='200'),
      httpStartTime?: long(name='HttpStartTime', example='12'),
      httpTiming?: string(name='HttpTiming', example='{"traceId":"0:1:10a94f66pts-2069351-allsparktask","requests":[{"lease":{"conn":{"duration":-1,"finish":-1,"operation":"conn","start":-1},"dns":{"duration":-1,"finish":-1,"operation":"dns","start":-1},"duration":-1,"finish":-1,"operation":"lease","start":32277914755},"recv":{"duration":225975,"finish":32283700284,"message":"","operation":"recv","start":32283474309},"sent":{"duration":594179,"finish":32278776504,"message":"","operation":"sent","start":32278182325},"tag":"GET http://tomcodemall.com:30080/api/product/skuinfo/list?key=2&vv=4&t4=%EF%BB%BF101"}],"message":""}'),
      importContent?: string(name='ImportContent', example='""'),
      nodeId?: string(name='NodeId', example='1345531'),
      rt?: string(name='Rt', example='230'),
      timestamp?: long(name='Timestamp', example='1650253024471'),
    }
  ](name='SamplingLogs'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model GetPtsDebugSampleLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsDebugSampleLogsResponseBody(name='body'),
}

async function getPtsDebugSampleLogsWithOptions(request: GetPtsDebugSampleLogsRequest, runtime: Util.RuntimeOptions): GetPtsDebugSampleLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsDebugSampleLogs',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsDebugSampleLogs(request: GetPtsDebugSampleLogsRequest): GetPtsDebugSampleLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsDebugSampleLogsWithOptions(request, runtime);
}

model GetPtsReportDetailsRequest {
  planId?: string(name='PlanId', example='OH5HA3VB'),
  sceneId?: string(name='SceneId', example='G5HCVS'),
}

model GetPtsReportDetailsResponseBody = {
  apiMetricsList?: [ 
    {
      allCount?: long(name='AllCount', example='1000'),
      apiName?: string(name='ApiName'),
      avgRt?: float(name='AvgRt', example='34.5'),
      avgTps?: float(name='AvgTps', example='55'),
      failCountBiz?: long(name='FailCountBiz', example='30'),
      failCountReq?: long(name='FailCountReq', example='40'),
      maxRt?: float(name='MaxRt', example='50'),
      minRt?: float(name='MinRt', example='10'),
      seg50Rt?: float(name='Seg50Rt', example='39'),
      seg75Rt?: float(name='Seg75Rt', example='26'),
      seg90Rt?: float(name='Seg90Rt', example='23'),
      seg99Rt?: float(name='Seg99Rt', example='35'),
      successRateBiz?: float(name='SuccessRateBiz', example='0.98'),
      successRateReq?: float(name='SuccessRateReq', example='0.99'),
    }
  ](name='ApiMetricsList'),
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  reportOverView?: {
    agentCount?: int32(name='AgentCount', example='1'),
    endTime?: string(name='EndTime', example='1988203944'),
    reportId?: string(name='ReportId', example='GHB56VD'),
    reportName?: string(name='ReportName'),
    startTime?: string(name='StartTime', example='1988202944'),
    vum?: long(name='Vum', example='100'),
  }(name='ReportOverView'),
  requestId?: string(name='RequestId', example='DC4E3177-6745-4925-B423-4E89VV34221A'),
  sceneMetrics?: {
    allCount?: long(name='AllCount', example='100000'),
    avgRt?: float(name='AvgRt', example='23'),
    avgTps?: float(name='AvgTps', example='78'),
    failCountBiz?: long(name='FailCountBiz', example='35'),
    failCountReq?: long(name='FailCountReq', example='34'),
    seg90Rt?: float(name='Seg90Rt', example='35'),
    seg99Rt?: float(name='Seg99Rt', example='56'),
    successRateBiz?: float(name='SuccessRateBiz', example='0.97'),
    successRateReq?: float(name='SuccessRateReq', example='0.99'),
  }(name='SceneMetrics'),
  sceneSnapShot?: {
    advanceSetting?: {
      connectionTimeoutInSecond?: int32(name='ConnectionTimeoutInSecond', example='5'),
      domainBindingList?: [ 
        {
          domain?: string(name='Domain', example='www.xxx.com'),
          ips?: [ string ](name='Ips'),
        }
      ](name='DomainBindingList'),
      logRate?: int32(name='LogRate', example='1'),
      successCode?: string(name='SuccessCode', example='429,404'),
    }(name='AdvanceSetting'),
    createTime?: string(name='CreateTime', example='12684449000'),
    fileParameterList?: [ 
      {
        fileName?: string(name='FileName', example='city.csv'),
        fileOssAddress?: string(name='FileOssAddress', example='https://www.sss.ccv'),
      }
    ](name='FileParameterList'),
    globalParameterList?: [ 
      {
        paramName?: string(name='ParamName', example='userName'),
        paramValue?: string(name='ParamValue', example='lisi'),
      }
    ](name='GlobalParameterList'),
    loadConfig?: {
      agentCount?: int32(name='AgentCount', example='1'),
      apiLoadConfigList?: [ 
        {
          rpsBegin?: int32(name='RpsBegin', example='10'),
          rpsLimit?: int32(name='RpsLimit', example='10'),
        }
      ](name='ApiLoadConfigList'),
      configuration?: {
        allConcurrencyBegin?: int32(name='AllConcurrencyBegin', example='10'),
        allConcurrencyLimit?: int32(name='AllConcurrencyLimit', example='10'),
        allRpsBegin?: int32(name='AllRpsBegin', example='80'),
        allRpsLimit?: int32(name='AllRpsLimit', example='160'),
      }(name='Configuration'),
      maxRunningTime?: int32(name='MaxRunningTime', example='2'),
      relationLoadConfigList?: [ 
        {
          concurrencyBegin?: int32(name='ConcurrencyBegin', example='10'),
          concurrencyLimit?: int32(name='ConcurrencyLimit', example='20'),
        }
      ](name='RelationLoadConfigList'),
      testMode?: string(name='TestMode', example='tps_mode'),
    }(name='LoadConfig'),
    modifiedTime?: string(name='ModifiedTime', example='2020-10-10 10:10:10'),
    relationList?: [ 
      {
        apiList?: [ 
          {
            apiId?: string(name='ApiId', description='API ID。', example='MNB45'),
            apiName?: string(name='ApiName'),
            body?: {
              bodyValue?: string(name='BodyValue', example='{key:value}'),
              contentType?: string(name='ContentType', example='application/x-www-form-urlencoded'),
            }(name='Body'),
            checkPointList?: [ 
              {
                checkPoint?: string(name='CheckPoint', example='userId'),
                checkType?: string(name='CheckType', example='EXPORTED_PARAM'),
                expectValue?: string(name='ExpectValue', example='111'),
                operator?: string(name='Operator', example='ctn'),
              }
            ](name='CheckPointList'),
            exportList?: [ 
              {
                count?: string(name='Count', example='1'),
                exportName?: string(name='ExportName', example='userId'),
                exportType?: string(name='ExportType', example='BODY_JSON'),
                exportValue?: string(name='ExportValue', example='data.userId'),
              }
            ](name='ExportList'),
            headerList?: [ 
              {
                headerName?: string(name='HeaderName', example='userName'),
                headerValue?: string(name='HeaderValue', example='1111'),
              }
            ](name='HeaderList'),
            method?: string(name='Method', example='GET'),
            redirectCountLimit?: int32(name='RedirectCountLimit', example='5'),
            timeoutInSecond?: int32(name='TimeoutInSecond', example='5'),
            url?: string(name='Url', example='https://www.xxx.com'),
          }
        ](name='ApiList'),
        fileParameterExplainList?: [ 
          {
            baseFile?: boolean(name='BaseFile', example='true'),
            cycleOnce?: boolean(name='CycleOnce', example='true'),
            fileName?: string(name='FileName', example='city.csv'),
            fileParamName?: string(name='FileParamName', example='address,name'),
          }
        ](name='FileParameterExplainList'),
        relationId?: string(name='RelationId', example='HGBN4D'),
        relationName?: string(name='RelationName'),
      }
    ](name='RelationList'),
    sceneId?: string(name='SceneId', example='7HBNS3'),
    sceneName?: string(name='SceneName'),
    status?: string(name='Status', example='STOPPED'),
  }(name='SceneSnapShot'),
  success?: boolean(name='Success', example='true'),
}

model GetPtsReportDetailsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsReportDetailsResponseBody(name='body'),
}

async function getPtsReportDetailsWithOptions(request: GetPtsReportDetailsRequest, runtime: Util.RuntimeOptions): GetPtsReportDetailsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsReportDetails',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsReportDetails(request: GetPtsReportDetailsRequest): GetPtsReportDetailsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsReportDetailsWithOptions(request, runtime);
}

model GetPtsReportsBySceneIdRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sceneId?: string(name='SceneId', example='NGBCD4K'),
}

model GetPtsReportsBySceneIdResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  reportOverViewList?: [ 
    {
      agentCount?: int32(name='AgentCount', example='1'),
      endTime?: string(name='EndTime', example='2021-02-26 16:38:30'),
      reportId?: string(name='ReportId', example='NGGB5FV'),
      reportName?: string(name='ReportName'),
      startTime?: string(name='StartTime', example='2021-02-26 16:28:30'),
      vum?: long(name='Vum', example='100'),
    }
  ](name='ReportOverViewList'),
  requestId?: string(name='RequestId', example='DC4E3177-6745-4925-B423-4E89VV34221A'),
  success?: boolean(name='Success', example='true'),
}

model GetPtsReportsBySceneIdResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsReportsBySceneIdResponseBody(name='body'),
}

async function getPtsReportsBySceneIdWithOptions(request: GetPtsReportsBySceneIdRequest, runtime: Util.RuntimeOptions): GetPtsReportsBySceneIdResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsReportsBySceneId',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsReportsBySceneId(request: GetPtsReportsBySceneIdRequest): GetPtsReportsBySceneIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsReportsBySceneIdWithOptions(request, runtime);
}

model GetPtsSceneRequest {
  sceneId?: string(name='SceneId', example='NKJBSH'),
}

model GetPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='DC4E3177-6745-4925-B423-4E89VV34221A'),
  scene?: {
    advanceSetting?: {
      connectionTimeoutInSecond?: int32(name='ConnectionTimeoutInSecond', example='5'),
      domainBindingList?: [ 
        {
          domain?: string(name='Domain', example='www.aliyundoc.com'),
          ips?: [ string ](name='Ips'),
        }
      ](name='DomainBindingList'),
      logRate?: int32(name='LogRate', example='1'),
      successCode?: string(name='SuccessCode', example='429,304'),
    }(name='AdvanceSetting'),
    createTime?: string(name='CreateTime', example='2021-02-26 15:30:30'),
    fileParameterList?: [ 
      {
        fileName?: string(name='FileName', example='city.csv'),
        fileOssAddress?: string(name='FileOssAddress', example='https://test.oss-cn-shanghai.aliyuncs.com/json.jar'),
      }
    ](name='FileParameterList'),
    globalParameterList?: [ 
      {
        paramName?: string(name='ParamName', example='userName'),
        paramValue?: string(name='ParamValue', example='lisi'),
      }
    ](name='GlobalParameterList'),
    headers?: [ 
      {
        name?: string(name='Name', example='key1'),
        value?: string(name='Value', example='value1'),
      }
    ](name='Headers'),
    loadConfig?: {
      agentCount?: int32(name='AgentCount', example='1'),
      apiLoadConfigList?: [ 
        {
          apiId?: string(name='ApiId', example='GBFDCV8'),
          rpsBegin?: int32(name='RpsBegin', example='10'),
          rpsLimit?: int32(name='RpsLimit', example='20'),
        }
      ](name='ApiLoadConfigList'),
      autoStep?: boolean(name='AutoStep', example='false'),
      configuration?: {
        allConcurrencyBegin?: int32(name='AllConcurrencyBegin', example='100'),
        allConcurrencyLimit?: int32(name='AllConcurrencyLimit', example='200'),
        allRpsBegin?: int32(name='AllRpsBegin', example='100'),
        allRpsLimit?: int32(name='AllRpsLimit', example='200'),
      }(name='Configuration'),
      increment?: int32(name='Increment', example='10'),
      keepTime?: int32(name='KeepTime', example='2'),
      maxRunningTime?: int32(name='MaxRunningTime', example='2'),
      relationLoadConfigList?: [ 
        {
          concurrencyBegin?: int32(name='ConcurrencyBegin', example='10'),
          concurrencyLimit?: int32(name='ConcurrencyLimit', example='20'),
          relationId?: string(name='RelationId', example='HNBGS7M'),
        }
      ](name='RelationLoadConfigList'),
      testMode?: string(name='TestMode', example='TPS'),
      vpcLoadConfig?: {
        regionId?: string(name='RegionId', example='cn-beijing'),
        securityGroupId?: string(name='SecurityGroupId', example='sg-jkasgfieiajidsjakjscb'),
        vSwitchId?: string(name='VSwitchId', example='vsw-skjfhlahsljkhsfalkjdoiw'),
        vpcId?: string(name='VpcId', example='vpc-akjhsdajgjsfggahjkga'),
      }(name='VpcLoadConfig'),
    }(name='LoadConfig'),
    modifiedTime?: string(name='ModifiedTime', example='2021-03-26 15:30:30'),
    relationList?: [ 
      {
        apiList?: [ 
          {
            apiId?: string(name='ApiId', example='GBFDCV8'),
            apiName?: string(name='ApiName'),
            body?: {
              bodyValue?: string(name='BodyValue', example='{\\"key1\\":\\"111\\",\\"key2\\":\\"222\\"}'),
              contentType?: string(name='ContentType', example='application/x-www-form-urlencoded'),
            }(name='Body'),
            checkPointList?: [ 
              {
                checkPoint?: string(name='CheckPoint', example='userId'),
                checkType?: string(name='CheckType', example='EXPORTED_PARAM'),
                expectValue?: string(name='ExpectValue', example='111'),
                operator?: string(name='Operator', example='ctn'),
              }
            ](name='CheckPointList'),
            exportList?: [ 
              {
                count?: string(name='Count', example='0'),
                exportName?: string(name='ExportName', example='data.username'),
                exportType?: string(name='ExportType', example='BODY_JSON'),
                exportValue?: string(name='ExportValue', example='username'),
              }
            ](name='ExportList'),
            headerList?: [ 
              {
                headerName?: string(name='HeaderName', example='userId'),
                headerValue?: string(name='HeaderValue', example='1111'),
              }
            ](name='HeaderList'),
            method?: string(name='Method', example='GET'),
            redirectCountLimit?: int32(name='RedirectCountLimit', example='5'),
            timeoutInSecond?: int32(name='TimeoutInSecond', example='5'),
            url?: string(name='Url', example='https://www.aliyundoc.com'),
          }
        ](name='ApiList'),
        fileParameterExplainList?: [ 
          {
            baseFile?: boolean(name='BaseFile', example='true'),
            cycleOnce?: boolean(name='CycleOnce', example='true'),
            fileName?: string(name='FileName', example='city.csv'),
            fileParamName?: string(name='FileParamName', example='userName,age'),
          }
        ](name='FileParameterExplainList'),
        relationId?: string(name='RelationId', example='HNBGS7M'),
        relationName?: string(name='RelationName'),
      }
    ](name='RelationList'),
    sceneId?: string(name='SceneId', example='BGFJ7GV'),
    sceneName?: string(name='SceneName'),
    status?: string(name='Status', example='Running'),
  }(name='Scene'),
  success?: boolean(name='Success', example='true'),
}

model GetPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsSceneResponseBody(name='body'),
}

async function getPtsSceneWithOptions(request: GetPtsSceneRequest, runtime: Util.RuntimeOptions): GetPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsScene(request: GetPtsSceneRequest): GetPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsSceneWithOptions(request, runtime);
}

model GetPtsSceneBaseLineRequest {
  sceneId?: string(name='SceneId', example='NB54CV'),
}

model GetPtsSceneBaseLineResponseBody = {
  baseline?: {
    apiBaselines?: [ 
      {
        avgRt?: float(name='AvgRt', example='10'),
        avgTps?: float(name='AvgTps', example='1000'),
        failCountBiz?: long(name='FailCountBiz', example='100'),
        failCountReq?: long(name='FailCountReq', example='100'),
        id?: long(name='Id', example='76543'),
        maxRt?: int32(name='MaxRt', example='50'),
        minRt?: int32(name='MinRt', example='8'),
        name?: string(name='Name'),
        seg90Rt?: float(name='Seg90Rt', example='40'),
        seg99Rt?: float(name='Seg99Rt', example='50'),
        successRateBiz?: float(name='SuccessRateBiz', example='0.1'),
        successRateReq?: float(name='SuccessRateReq', example='0.9'),
      }
    ](name='ApiBaselines'),
    name?: string(name='Name'),
    sceneBaseline?: {
      avgRt?: float(name='AvgRt', example='10'),
      avgTps?: float(name='AvgTps', example='1000'),
      failCountBiz?: long(name='FailCountBiz', example='1000'),
      failCountReq?: long(name='FailCountReq', example='1000'),
      seg90Rt?: float(name='Seg90Rt', example='10'),
      seg99Rt?: float(name='Seg99Rt', example='10'),
      successRateBiz?: float(name='SuccessRateBiz', example='0.1'),
      successRateReq?: float(name='SuccessRateReq', example='0.9'),
    }(name='SceneBaseline'),
  }(name='Baseline'),
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2CE0-AE4C-4143-955A-8E4595AF86A6'),
  sceneId?: string(name='SceneId', example='NHG67BF'),
  success?: boolean(name='Success', example='true'),
}

model GetPtsSceneBaseLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsSceneBaseLineResponseBody(name='body'),
}

async function getPtsSceneBaseLineWithOptions(request: GetPtsSceneBaseLineRequest, runtime: Util.RuntimeOptions): GetPtsSceneBaseLineResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsSceneBaseLine',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsSceneBaseLine(request: GetPtsSceneBaseLineRequest): GetPtsSceneBaseLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsSceneBaseLineWithOptions(request, runtime);
}

model GetPtsSceneRunningDataRequest {
  planId?: string(name='PlanId', example='NHBGVF8'),
  sceneId?: string(name='SceneId', example='NKKI6GB'),
}

model GetPtsSceneRunningDataResponseBody = {
  agentLocation?: [ 
    {
      count?: int32(name='Count', example='10'),
      isp?: string(name='Isp'),
      province?: string(name='Province'),
      region?: string(name='Region'),
    }
  ](name='AgentLocation'),
  aliveAgents?: int32(name='AliveAgents', example='10'),
  averageRt?: long(name='AverageRt', example='45'),
  beginTime?: long(name='BeginTime', example='1651895518339'),
  chainMonitorDataList?: [ 
    {
      apiId?: string(name='ApiId', example='ANBDC8B'),
      apiName?: string(name='ApiName'),
      averageRt?: int32(name='AverageRt', example='46'),
      checkPointResult?: {
        failedBusinessCount?: long(name='FailedBusinessCount', example='1000'),
        failedBusinessQps?: float(name='FailedBusinessQps', example='78'),
        succeedBusinessCount?: long(name='SucceedBusinessCount', example='908'),
        succeedBusinessQps?: float(name='SucceedBusinessQps', example='89'),
      }(name='CheckPointResult'),
      concurrency?: float(name='Concurrency', example='100'),
      configQps?: int32(name='ConfigQps', example='78'),
      count2XX?: long(name='Count2XX', example='7890'),
      failedCount?: long(name='FailedCount', example='456'),
      failedQps?: float(name='FailedQps', example='15'),
      maxRt?: int32(name='MaxRt', example='56'),
      minRt?: int32(name='MinRt', example='16'),
      nodeId?: long(name='NodeId', example='78509'),
      qps2XX?: float(name='Qps2XX', example='78'),
      realQps?: float(name='RealQps', example='23'),
      timePoint?: long(name='TimePoint', example='1278908899'),
    }
  ](name='ChainMonitorDataList'),
  code?: string(name='Code', example='4001'),
  concurrency?: int32(name='Concurrency', example='10'),
  concurrencyLimit?: int32(name='ConcurrencyLimit', example='20'),
  failedBusinessCount?: long(name='FailedBusinessCount', example='78'),
  failedRequestCount?: long(name='FailedRequestCount', example='90'),
  hasReport?: boolean(name='HasReport', example='false'),
  httpStatusCode?: int32(name='HttpStatusCode', example='400'),
  message?: string(name='Message', example='no message'),
  requestBps?: string(name='RequestBps', example='89kb'),
  requestId?: string(name='RequestId', example='DC4E3177-6745-4925-B423-4E89VV34221A'),
  responseBps?: string(name='ResponseBps', example='8kb'),
  seg90Rt?: long(name='Seg90Rt', example='45'),
  status?: int32(name='Status', example='6'),
  success?: boolean(name='Success', example='true'),
  totalAgents?: int32(name='TotalAgents', example='10'),
  totalRealQps?: int32(name='TotalRealQps'),
  totalRequestCount?: long(name='TotalRequestCount', example='8900'),
  tpsLimit?: int32(name='TpsLimit', example='80'),
  vum?: long(name='Vum', example='100'),
}

model GetPtsSceneRunningDataResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsSceneRunningDataResponseBody(name='body'),
}

async function getPtsSceneRunningDataWithOptions(request: GetPtsSceneRunningDataRequest, runtime: Util.RuntimeOptions): GetPtsSceneRunningDataResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsSceneRunningData',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsSceneRunningData(request: GetPtsSceneRunningDataRequest): GetPtsSceneRunningDataResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsSceneRunningDataWithOptions(request, runtime);
}

model GetPtsSceneRunningStatusRequest {
  sceneId?: string(name='SceneId', example='NHBG6V'),
}

model GetPtsSceneRunningStatusResponseBody = {
  code?: string(name='Code', example='4001'),
  createTime?: string(name='CreateTime', example='2021-03-01 16:05:56'),
  httpStatusCode?: int32(name='HttpStatusCode', example='400'),
  message?: string(name='Message'),
  modifiedTime?: string(name='ModifiedTime', example='2021-03-26 16:03:56'),
  requestId?: string(name='RequestId', example='DC4E3177-6745-4925-B423-4E89VV34221A'),
  sceneName?: string(name='SceneName'),
  status?: string(name='Status', example='RUNNING'),
  success?: boolean(name='Success', example='false'),
}

model GetPtsSceneRunningStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPtsSceneRunningStatusResponseBody(name='body'),
}

async function getPtsSceneRunningStatusWithOptions(request: GetPtsSceneRunningStatusRequest, runtime: Util.RuntimeOptions): GetPtsSceneRunningStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetPtsSceneRunningStatus',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getPtsSceneRunningStatus(request: GetPtsSceneRunningStatusRequest): GetPtsSceneRunningStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return getPtsSceneRunningStatusWithOptions(request, runtime);
}

model GetUserVpcSecurityGroupRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  vpcId?: string(name='VpcId', example='vpc-bp10xjz7c7oqjgasodihj1kx7t'),
}

model GetUserVpcSecurityGroupResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='61B15017-1A68-5C47-834F-87E2BBC44F2C'),
  securityGroupCount?: int32(name='SecurityGroupCount', example='9'),
  securityGroupList?: [ 
    {
      description?: string(name='Description'),
      securityGroupId?: string(name='SecurityGroupId', example='sg-bp16bt3zuugxpfjkasdfvthxth8'),
      securityGroupName?: string(name='SecurityGroupName', example='my-security-group'),
      vpcId?: string(name='VpcId', example='vpc-uf6tar2ohlasdhsatjln37h30bv'),
    }
  ](name='SecurityGroupList'),
  success?: boolean(name='Success', example='true'),
}

model GetUserVpcSecurityGroupResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserVpcSecurityGroupResponseBody(name='body'),
}

async function getUserVpcSecurityGroupWithOptions(request: GetUserVpcSecurityGroupRequest, runtime: Util.RuntimeOptions): GetUserVpcSecurityGroupResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserVpcSecurityGroup',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserVpcSecurityGroup(request: GetUserVpcSecurityGroupRequest): GetUserVpcSecurityGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserVpcSecurityGroupWithOptions(request, runtime);
}

model GetUserVpcVSwitchRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  vpcId?: string(name='VpcId', example='vpc-2ze22scdz2ebdfjasdfjkqhf4pyj'),
}

model GetUserVpcVSwitchResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='5'),
  requestId?: string(name='RequestId', example='0235E5FC-4C7C-5F0C-843C-FC674F15F947'),
  success?: boolean(name='Success', example='true'),
  vSwitchCount?: int32(name='VSwitchCount', example='6'),
  vSwitchList?: [ 
    {
      availableIpAddressCount?: long(name='AvailableIpAddressCount', example='1000'),
      maxAgentCount?: int32(name='MaxAgentCount', example='1000'),
      vSwitchId?: string(name='VSwitchId', example='vsw-bp1eil9df23rsd8l1sevebiszooj'),
      vSwitchName?: string(name='VSwitchName', example='my-vswitch'),
      vpcId?: string(name='VpcId', example='vpc-wz9bpdaebft6j23fesdf84v2f1um3a'),
    }
  ](name='VSwitchList'),
}

model GetUserVpcVSwitchResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserVpcVSwitchResponseBody(name='body'),
}

async function getUserVpcVSwitchWithOptions(request: GetUserVpcVSwitchRequest, runtime: Util.RuntimeOptions): GetUserVpcVSwitchResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserVpcVSwitch',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserVpcVSwitch(request: GetUserVpcVSwitchRequest): GetUserVpcVSwitchResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserVpcVSwitchWithOptions(request, runtime);
}

model GetUserVpcsRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='1'),
  regionId?: string(name='RegionId', example='cn-hangzhou'),
  vpcId?: string(name='VpcId', example='vpc-2ze22asdfuwiea2ebjkqhf4pyj'),
}

model GetUserVpcsResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='CEE46204-E1CF-5F48-B094-67362DD4B73F'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
  vpcs?: [ 
    {
      cidrBlock?: string(name='CidrBlock', example='172.16.80.0/20'),
      description?: string(name='Description'),
      regionId?: string(name='RegionId', example='cn-hangzhou'),
      resourceGroupId?: string(name='ResourceGroupId', example='rg-acfm3fzmgkehpewjertna'),
      routerTableIds?: [ string ](name='RouterTableIds'),
      vSwitchIds?: [ string ](name='VSwitchIds'),
      vpcId?: string(name='VpcId', example='vpc-uf6gc56wdjpafoiwej6adqb4qn72xtw'),
      vpcName?: string(name='VpcName', example='shanghai-vpc'),
    }
  ](name='Vpcs'),
}

model GetUserVpcsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserVpcsResponseBody(name='body'),
}

async function getUserVpcsWithOptions(request: GetUserVpcsRequest, runtime: Util.RuntimeOptions): GetUserVpcsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!Util.isUnset(request.vpcId)) {
    query['VpcId'] = request.vpcId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetUserVpcs',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getUserVpcs(request: GetUserVpcsRequest): GetUserVpcsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserVpcsWithOptions(request, runtime);
}

model ListEnvsRequest {
  envId?: string(name='EnvId', example='10YPA8H'),
  envName?: string(name='EnvName', example='test-create'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListEnvsResponseBody = {
  code?: string(name='Code', example='200'),
  envs?: [ 
    {
      createTime?: long(name='CreateTime', example='1637053715165'),
      envId?: string(name='EnvId', example='86S1LH'),
      envName?: string(name='EnvName', example='test-create'),
      envVersion?: string(name='EnvVersion', example='5.0'),
      files?: [ 
        {
          fileId?: long(name='FileId', example='61660'),
          fileName?: string(name='FileName', example='json.jar'),
          fileOssAddress?: string(name='FileOssAddress', example='https://test.oss-cn-shanghai.aliyuncs.com/json.jar'),
          fileSize?: long(name='FileSize', example='788'),
          md5?: string(name='Md5', example='43B584026CE5E570F3DE638FA7EEF9E0'),
        }
      ](name='Files'),
      modifiedTime?: long(name='ModifiedTime', example='1637053719165'),
      properties?: [ 
        {
          description?: string(name='Description', example='远程主机'),
          name?: string(name='Name', example='remote_hosts'),
          value?: string(name='Value', example='127.0.0.1'),
        }
      ](name='Properties'),
      relatedScenes?: [ string ](name='RelatedScenes'),
      runningScenes?: [ string ](name='RunningScenes'),
      usedCapacity?: long(name='UsedCapacity', example='26668'),
    }
  ](name='Envs'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ListEnvsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEnvsResponseBody(name='body'),
}

async function listEnvsWithOptions(request: ListEnvsRequest, runtime: Util.RuntimeOptions): ListEnvsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  if (!Util.isUnset(request.envName)) {
    query['EnvName'] = request.envName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEnvs',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listEnvs(request: ListEnvsRequest): ListEnvsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEnvsWithOptions(request, runtime);
}

model ListJMeterReportsRequest {
  beginTime?: long(name='BeginTime', example='1637115303000'),
  endTime?: long(name='EndTime', example='1637115306000'),
  keyword?: string(name='Keyword', example='test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reportId?: string(name='ReportId', example='7R4RE352'),
  sceneId?: string(name='SceneId', example='10YPA8H'),
}

model ListJMeterReportsResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reports?: [ 
    {
      actualStartTime?: long(name='ActualStartTime', example='1637157073000'),
      duration?: string(name='Duration', example='10分钟'),
      reportId?: string(name='ReportId', example='7R4RE352'),
      reportName?: string(name='ReportName', example='test'),
      vum?: long(name='Vum', example='1000'),
    }
  ](name='Reports'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ListJMeterReportsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListJMeterReportsResponseBody(name='body'),
}

async function listJMeterReportsWithOptions(request: ListJMeterReportsRequest, runtime: Util.RuntimeOptions): ListJMeterReportsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.beginTime)) {
    query['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    query['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reportId)) {
    query['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJMeterReports',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listJMeterReports(request: ListJMeterReportsRequest): ListJMeterReportsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listJMeterReportsWithOptions(request, runtime);
}

model ListOpenJMeterScenesRequest {
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  sceneId?: string(name='SceneId', example='DYYPZIH'),
  sceneName?: string(name='SceneName', example='test'),
}

model ListOpenJMeterScenesResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  JMeterScene?: [ 
    {
      durationStr?: string(name='DurationStr', example='10分钟'),
      sceneId?: string(name='SceneId', example='DYYPZIH'),
      sceneName?: string(name='SceneName', example='test'),
      status?: string(name='Status'),
    }
  ](name='JMeterScene'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ListOpenJMeterScenesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOpenJMeterScenesResponseBody(name='body'),
}

async function listOpenJMeterScenesWithOptions(request: ListOpenJMeterScenesRequest, runtime: Util.RuntimeOptions): ListOpenJMeterScenesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  if (!Util.isUnset(request.sceneName)) {
    query['SceneName'] = request.sceneName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListOpenJMeterScenes',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listOpenJMeterScenes(request: ListOpenJMeterScenesRequest): ListOpenJMeterScenesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listOpenJMeterScenesWithOptions(request, runtime);
}

model ListPtsReportsRequest {
  beginTime?: long(name='BeginTime', example='1637115303000'),
  endTime?: long(name='EndTime', example='1637115306000'),
  keyword?: string(name='Keyword', example='test'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reportId?: string(name='ReportId', example='7RLPM3Y2'),
  sceneId?: string(name='SceneId', example='1PDAL8H'),
}

model ListPtsReportsResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  reports?: [ 
    {
      actualStartTime?: long(name='ActualStartTime', example='1637157073000'),
      duration?: string(name='Duration', example='10分钟'),
      reportId?: string(name='ReportId', example='7RLPM3Y2'),
      reportName?: string(name='ReportName', example='test'),
      vum?: long(name='Vum', example='1000'),
    }
  ](name='Reports'),
  requestId?: string(name='RequestId', example='A8E4LR80-15P1-555A-9ZZF-B736AZO5E5ID'),
  success?: boolean(name='Success', example='true'),
  totalCount?: long(name='TotalCount', example='100'),
}

model ListPtsReportsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPtsReportsResponseBody(name='body'),
}

async function listPtsReportsWithOptions(request: ListPtsReportsRequest, runtime: Util.RuntimeOptions): ListPtsReportsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.beginTime)) {
    body['BeginTime'] = request.beginTime;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.keyword)) {
    body['Keyword'] = request.keyword;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.reportId)) {
    body['ReportId'] = request.reportId;
  }
  if (!Util.isUnset(request.sceneId)) {
    body['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListPtsReports',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPtsReports(request: ListPtsReportsRequest): ListPtsReportsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPtsReportsWithOptions(request, runtime);
}

model ListPtsSceneRequest {
  keyWord?: string(name='KeyWord'),
  pageNumber?: int32(name='PageNumber', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
}

model ListPtsSceneResponseBody = {
  code?: string(name='Code', example='4001'),
  httpStatusCode?: int32(name='HttpStatusCode', example='400'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='DD6F2ED8-E31B-497F-85AB-C4E358A5F667'),
  sceneViewList?: [ 
    {
      createTime?: string(name='CreateTime', example='2021-02-26 15:28:39'),
      sceneId?: string(name='SceneId', example='DFGVS3S'),
      sceneName?: string(name='SceneName'),
      status?: string(name='Status'),
    }
  ](name='SceneViewList'),
  success?: boolean(name='Success', example='false'),
}

model ListPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPtsSceneResponseBody(name='body'),
}

async function listPtsSceneWithOptions(request: ListPtsSceneRequest, runtime: Util.RuntimeOptions): ListPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.keyWord)) {
    query['KeyWord'] = request.keyWord;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPtsScene(request: ListPtsSceneRequest): ListPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPtsSceneWithOptions(request, runtime);
}

model ModifyPtsSceneRequest {
  scene?: string(name='Scene', example='SD6YZCI'),
}

model ModifyPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='449ADAFB-8DA4-4317-A284-4922D04DE828'),
  success?: boolean(name='Success', example='true'),
}

model ModifyPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ModifyPtsSceneResponseBody(name='body'),
}

async function modifyPtsSceneWithOptions(request: ModifyPtsSceneRequest, runtime: Util.RuntimeOptions): ModifyPtsSceneResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.scene)) {
    body['Scene'] = request.scene;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ModifyPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyPtsScene(request: ModifyPtsSceneRequest): ModifyPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyPtsSceneWithOptions(request, runtime);
}

model RemoveEnvRequest {
  envId?: string(name='EnvId', example='10YPA8H'),
}

model RemoveEnvResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model RemoveEnvResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveEnvResponseBody(name='body'),
}

async function removeEnvWithOptions(request: RemoveEnvRequest, runtime: Util.RuntimeOptions): RemoveEnvResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.envId)) {
    query['EnvId'] = request.envId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveEnv',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeEnv(request: RemoveEnvRequest): RemoveEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeEnvWithOptions(request, runtime);
}

model RemoveOpenJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model RemoveOpenJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model RemoveOpenJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: RemoveOpenJMeterSceneResponseBody(name='body'),
}

async function removeOpenJMeterSceneWithOptions(request: RemoveOpenJMeterSceneRequest, runtime: Util.RuntimeOptions): RemoveOpenJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RemoveOpenJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeOpenJMeterScene(request: RemoveOpenJMeterSceneRequest): RemoveOpenJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeOpenJMeterSceneWithOptions(request, runtime);
}

model SaveEnvRequest {
  env?: {
    envId?: string(name='EnvId', example='10YPA8H'),
    envName?: string(name='EnvName', example='test-create'),
    files?: [ 
      {
        fileName?: string(name='FileName', example='json.jar'),
        fileOssAddress?: string(name='FileOssAddress', example='https://test.oss-cn-shanghai.aliyuncs.com/json.jar'),
      }
    ](name='Files'),
    jmeterPluginLabel?: string(name='JmeterPluginLabel', example='test'),
    properties?: [ 
      {
        description?: string(name='Description', example='远程主机'),
        name?: string(name='Name', example='remote_hosts'),
        value?: string(name='Value', example='127.0.0.1'),
      }
    ](name='Properties'),
  }(name='Env'),
}

model SaveEnvShrinkRequest {
  envShrink?: string(name='Env'),
}

model SaveEnvResponseBody = {
  code?: string(name='Code', example='200'),
  envId?: string(name='EnvId', example='10YPA8H'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model SaveEnvResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveEnvResponseBody(name='body'),
}

async function saveEnvWithOptions(tmpReq: SaveEnvRequest, runtime: Util.RuntimeOptions): SaveEnvResponse {
  Util.validateModel(tmpReq);
  var request = new SaveEnvShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.env)) {
    request.envShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.env, 'Env', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.envShrink)) {
    query['Env'] = request.envShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SaveEnv',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveEnv(request: SaveEnvRequest): SaveEnvResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveEnvWithOptions(request, runtime);
}

model SaveOpenJMeterSceneRequest {
  openJMeterScene?: {
    agentCount?: int32(name='AgentCount', example='2'),
    concurrency?: int32(name='Concurrency', example='1000'),
    constantThroughputTimerType?: string(name='ConstantThroughputTimerType', example='GLOBAL'),
    dnsCacheConfig?: {
      clearCacheEachIteration?: boolean(name='ClearCacheEachIteration', example='true'),
      dnsServers?: [ string ](name='DnsServers'),
      hostTable?: map[string]string(name='HostTable'),
    }(name='DnsCacheConfig'),
    duration?: int32(name='Duration', example='600'),
    environmentId?: string(name='EnvironmentId', example='I8PZIH'),
    fileList?: [ 
      {
        fileId?: long(name='FileId', example='61232'),
        fileName?: string(name='FileName', example='baidu.jmx'),
        fileOssAddress?: string(name='FileOssAddress', example='https://test.cn-shanghai.aliyuncs.com/baidu.jmx'),
        fileSize?: long(name='FileSize', example='28880'),
        md5?: string(name='Md5', example='DA70F97A74D76B6A3BEF9CC8AE0D89EB'),
        splitCsv?: boolean(name='SplitCsv', example='false'),
        tags?: string(name='Tags'),
      }
    ](name='FileList'),
    isVpcTest?: boolean(name='IsVpcTest', example='true'),
    JMeterProperties?: [ 
      {
        name?: string(name='Name', example='https.sessioncontext.shared'),
        value?: string(name='Value', example='false'),
      }
    ](name='JMeterProperties'),
    jmeterPluginLabel?: string(name='JmeterPluginLabel', example='test'),
    maxRps?: int32(name='MaxRps', example='100'),
    mode?: string(name='Mode', example='CONCURRENCY'),
    rampUp?: int32(name='RampUp', example='600'),
    regionId?: string(name='RegionId', example='cn-beijing'),
    regionalCondition?: [ 
      {
        amount?: int32(name='Amount'),
        region?: string(name='Region'),
      }
    ](name='RegionalCondition'),
    sceneId?: string(name='SceneId', example='DYYPZIH'),
    sceneName?: string(name='SceneName', example='test'),
    securityGroupId?: string(name='SecurityGroupId', example='sg-2zeid0dd7bhahsgdahspaly'),
    startConcurrency?: int32(name='StartConcurrency', example='10'),
    startRps?: int32(name='StartRps', example='10'),
    steps?: int32(name='Steps', example='3'),
    syncTimerType?: string(name='SyncTimerType', example='GLOBAL'),
    testFile?: string(name='TestFile', example='baidu.jmx'),
    vSwitchId?: string(name='VSwitchId', example='vsw-2zehsgdhsahw1r'),
    vpcId?: string(name='VpcId', example='vpc-2ze2sahjdgahsebjkqhf4pyj'),
  }(name='OpenJMeterScene'),
}

model SaveOpenJMeterSceneShrinkRequest {
  openJMeterSceneShrink?: string(name='OpenJMeterScene'),
}

model SaveOpenJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  sceneId?: string(name='SceneId', example='DYYPZIH'),
  success?: boolean(name='Success', example='true'),
}

model SaveOpenJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SaveOpenJMeterSceneResponseBody(name='body'),
}

async function saveOpenJMeterSceneWithOptions(tmpReq: SaveOpenJMeterSceneRequest, runtime: Util.RuntimeOptions): SaveOpenJMeterSceneResponse {
  Util.validateModel(tmpReq);
  var request = new SaveOpenJMeterSceneShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.openJMeterScene)) {
    request.openJMeterSceneShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.openJMeterScene, 'OpenJMeterScene', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.openJMeterSceneShrink)) {
    query['OpenJMeterScene'] = request.openJMeterSceneShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SaveOpenJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function saveOpenJMeterScene(request: SaveOpenJMeterSceneRequest): SaveOpenJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return saveOpenJMeterSceneWithOptions(request, runtime);
}

model SavePtsSceneRequest {
  scene?: {
    advanceSetting?: {
      connectionTimeoutInSecond?: int32(name='ConnectionTimeoutInSecond', example='5'),
      domainBindingList?: [ 
        {
          domain?: string(name='Domain', example='www.example.com'),
          ips?: [ string ](name='Ips'),
        }
      ](name='DomainBindingList'),
      logRate?: int32(name='LogRate', example='1'),
      successCode?: string(name='SuccessCode', example='205'),
    }(name='AdvanceSetting'),
    fileParameterList?: [ 
      {
        fileName?: string(name='FileName', example='test.csv'),
        fileOssAddress?: string(name='FileOssAddress', example='https://jmeter-pts-testing-version.oss-cn-shanghai.aliyuncs.com/param-file.csv'),
      }
    ](name='FileParameterList'),
    globalParameterList?: [ 
      {
        paramName?: string(name='ParamName', example='global'),
        paramValue?: string(name='ParamValue', example='11111'),
      }
    ](name='GlobalParameterList'),
    loadConfig?: {
      agentCount?: int32(name='AgentCount', example='1'),
      apiLoadConfigList?: [ 
        {
          apiId?: string(name='ApiId', description='API ID。', example='1'),
          rpsBegin?: int32(name='RpsBegin', example='100'),
          rpsLimit?: int32(name='RpsLimit', example='100'),
        }
      ](name='ApiLoadConfigList'),
      autoStep?: boolean(name='AutoStep', example='true'),
      configuration?: {
        allConcurrencyBegin?: int32(name='AllConcurrencyBegin', example='100'),
        allConcurrencyLimit?: int32(name='AllConcurrencyLimit', example='100'),
        allRpsBegin?: int32(name='AllRpsBegin', example='100'),
        allRpsLimit?: int32(name='AllRpsLimit', example='100'),
      }(name='Configuration'),
      increment?: int32(name='Increment', example='30'),
      keepTime?: int32(name='KeepTime', example='3'),
      maxRunningTime?: int32(name='MaxRunningTime', example='10'),
      relationLoadConfigList?: [ 
        {
          concurrencyBegin?: int32(name='ConcurrencyBegin', example='100'),
          concurrencyLimit?: int32(name='ConcurrencyLimit', example='100'),
          relationId?: string(name='RelationId', example='1'),
        }
      ](name='RelationLoadConfigList'),
      testMode?: string(name='TestMode', example='concurrency_mode'),
      vpcLoadConfig?: {
        regionId?: string(name='RegionId', example='cn-beijing'),
        securityGroupId?: string(name='SecurityGroupId', example='sg-jkasgfieiajidsjakjscb'),
        vSwitchId?: string(name='VSwitchId', example='vsw-skjfhlahsljkhsfalkjdoiw'),
        vpcId?: string(name='VpcId', description='VPC ID。', example='vpc-akjhsdajgjsfggahjkga'),
      }(name='VpcLoadConfig'),
    }(name='LoadConfig'),
    relationList?: [ 
      {
        apiList?: [ 
          {
            apiId?: string(name='ApiId', example='1'),
            apiName?: string(name='ApiName', example='api'),
            body?: {
              bodyValue?: string(name='BodyValue', example='{\\"global\\":\\"${global}\\",\\"name\\":\\"${name}\\"}'),
              contentType?: string(name='ContentType', example='application/x-www-form-urlencoded'),
            }(name='Body'),
            checkPointList?: [ 
              {
                checkPoint?: string(name='CheckPoint', example='userId'),
                checkType?: string(name='CheckType', example='EXPORTED_PARAM'),
                expectValue?: string(name='ExpectValue', example='111'),
                operator?: string(name='Operator', example='ctn'),
              }
            ](name='CheckPointList'),
            exportList?: [ 
              {
                count?: string(name='Count', example='0'),
                exportName?: string(name='ExportName', example='test'),
                exportType?: string(name='ExportType', example='BODY_JSON'),
                exportValue?: string(name='ExportValue', example='data.itemlist[0]'),
              }
            ](name='ExportList'),
            headerList?: [ 
              {
                headerName?: string(name='HeaderName', example='Accept-Encoding'),
                headerValue?: string(name='HeaderValue', example='gzip, deflate, br'),
              }
            ](name='HeaderList'),
            method?: string(name='Method', example='GET'),
            redirectCountLimit?: int32(name='RedirectCountLimit', example='0'),
            timeoutInSecond?: int32(name='TimeoutInSecond', example='5'),
            url?: string(name='Url', example='http://www.example.com'),
          }
        ](name='ApiList'),
        fileParameterExplainList?: [ 
          {
            baseFile?: boolean(name='BaseFile', example='true'),
            cycleOnce?: boolean(name='CycleOnce', example='true'),
            fileName?: string(name='FileName', example='fileName.csv'),
            fileParamName?: string(name='FileParamName', example='name,uid,age'),
          }
        ](name='FileParameterExplainList'),
        relationId?: string(name='RelationId', example='1'),
        relationName?: string(name='RelationName'),
      }
    ](name='RelationList'),
    sceneId?: string(name='SceneId', example='IUYAHGJ'),
    sceneName?: string(name='SceneName', example='test'),
  }(name='Scene'),
}

model SavePtsSceneShrinkRequest {
  sceneShrink?: string(name='Scene'),
}

model SavePtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  sceneId?: string(name='SceneId', example='IUYAHGJ'),
  success?: boolean(name='Success', example='true'),
}

model SavePtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SavePtsSceneResponseBody(name='body'),
}

async function savePtsSceneWithOptions(tmpReq: SavePtsSceneRequest, runtime: Util.RuntimeOptions): SavePtsSceneResponse {
  Util.validateModel(tmpReq);
  var request = new SavePtsSceneShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.scene)) {
    request.sceneShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.scene, 'Scene', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.sceneShrink)) {
    query['Scene'] = request.sceneShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SavePtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function savePtsScene(request: SavePtsSceneRequest): SavePtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return savePtsSceneWithOptions(request, runtime);
}

model StartDebugPtsSceneRequest {
  sceneId?: string(name='SceneId', example='NHBGB8B'),
}

model StartDebugPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  planId?: string(name='PlanId', example='NJJBH8B'),
  requestId?: string(name='RequestId', example='C1905194-EE28-4F78-AD81-85A40D52D1BC'),
  success?: boolean(name='Success', example='true'),
}

model StartDebugPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartDebugPtsSceneResponseBody(name='body'),
}

async function startDebugPtsSceneWithOptions(request: StartDebugPtsSceneRequest, runtime: Util.RuntimeOptions): StartDebugPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartDebugPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startDebugPtsScene(request: StartDebugPtsSceneRequest): StartDebugPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return startDebugPtsSceneWithOptions(request, runtime);
}

model StartDebuggingJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model StartDebuggingJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  reportId?: string(name='ReportId', example='MH0SU1I'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model StartDebuggingJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartDebuggingJMeterSceneResponseBody(name='body'),
}

async function startDebuggingJMeterSceneWithOptions(request: StartDebuggingJMeterSceneRequest, runtime: Util.RuntimeOptions): StartDebuggingJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartDebuggingJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startDebuggingJMeterScene(request: StartDebuggingJMeterSceneRequest): StartDebuggingJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return startDebuggingJMeterSceneWithOptions(request, runtime);
}

model StartPtsSceneRequest {
  sceneId?: string(name='SceneId', example='FGSRA3'),
}

model StartPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  planId?: string(name='PlanId', example='SFVAFE'),
  requestId?: string(name='RequestId', example='BD12DCC9-5E48-4E77-9657-8D34D8C0F97B'),
  success?: boolean(name='Success', example='true'),
}

model StartPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartPtsSceneResponseBody(name='body'),
}

async function startPtsSceneWithOptions(request: StartPtsSceneRequest, runtime: Util.RuntimeOptions): StartPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startPtsScene(request: StartPtsSceneRequest): StartPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return startPtsSceneWithOptions(request, runtime);
}

model StartTestingJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model StartTestingJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  reportId?: string(name='ReportId', example='MH0SU1I'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model StartTestingJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTestingJMeterSceneResponseBody(name='body'),
}

async function startTestingJMeterSceneWithOptions(request: StartTestingJMeterSceneRequest, runtime: Util.RuntimeOptions): StartTestingJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartTestingJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startTestingJMeterScene(request: StartTestingJMeterSceneRequest): StartTestingJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTestingJMeterSceneWithOptions(request, runtime);
}

model StopDebugPtsSceneRequest {
  planId?: string(name='PlanId', example='FVDC7HB'),
  sceneId?: string(name='SceneId', example='RDDCF7'),
}

model StopDebugPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='0AE6505C-55CE-444A-B73B-810D0ED27C66'),
  success?: boolean(name='Success', example='true'),
}

model StopDebugPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopDebugPtsSceneResponseBody(name='body'),
}

async function stopDebugPtsSceneWithOptions(request: StopDebugPtsSceneRequest, runtime: Util.RuntimeOptions): StopDebugPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.planId)) {
    query['PlanId'] = request.planId;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopDebugPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopDebugPtsScene(request: StopDebugPtsSceneRequest): StopDebugPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopDebugPtsSceneWithOptions(request, runtime);
}

model StopDebuggingJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model StopDebuggingJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model StopDebuggingJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopDebuggingJMeterSceneResponseBody(name='body'),
}

async function stopDebuggingJMeterSceneWithOptions(request: StopDebuggingJMeterSceneRequest, runtime: Util.RuntimeOptions): StopDebuggingJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopDebuggingJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopDebuggingJMeterScene(request: StopDebuggingJMeterSceneRequest): StopDebuggingJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopDebuggingJMeterSceneWithOptions(request, runtime);
}

model StopPtsSceneRequest {
  sceneId?: string(name='SceneId', example='GV4DEBG'),
}

model StopPtsSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='DD6F2ED8-E31B-497F-85AB-C4E358A5F6F9'),
  success?: boolean(name='Success', example='true'),
}

model StopPtsSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopPtsSceneResponseBody(name='body'),
}

async function stopPtsSceneWithOptions(request: StopPtsSceneRequest, runtime: Util.RuntimeOptions): StopPtsSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopPtsScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopPtsScene(request: StopPtsSceneRequest): StopPtsSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopPtsSceneWithOptions(request, runtime);
}

model StopTestingJMeterSceneRequest {
  sceneId?: string(name='SceneId', example='DYYPZIH'),
}

model StopTestingJMeterSceneResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='A8E16480-15C1-555A-922F-B736A005E52D'),
  success?: boolean(name='Success', example='true'),
}

model StopTestingJMeterSceneResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopTestingJMeterSceneResponseBody(name='body'),
}

async function stopTestingJMeterSceneWithOptions(request: StopTestingJMeterSceneRequest, runtime: Util.RuntimeOptions): StopTestingJMeterSceneResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopTestingJMeterScene',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopTestingJMeterScene(request: StopTestingJMeterSceneRequest): StopTestingJMeterSceneResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopTestingJMeterSceneWithOptions(request, runtime);
}

model UpdatePtsSceneBaseLineRequest {
  apiBaselines?: map[string]any(name='ApiBaselines', example='[{"avgRt":1,"avgTps":1,"failCountBiz":1,"failCountReq":182381,"id":362447,"maxRt":3051,"minRt":0,"name":"1-1","seg50Rt":1,"seg75Rt":1,"seg90Rt":1,"seg99Rt":3,"successRateBiz":1,"successRateReq":0,"timingConnAvg":0},{"avgRt":1.06,"avgTps":1,"failCountBiz":0,"failCountReq":151143,"id":362446,"maxRt":3068,"minRt":0,"name":"dd","seg50Rt":1,"seg75Rt":1,"seg90Rt":1,"seg99Rt":2,"successRateBiz":1,"successRateReq":0}]'),
  sceneBaseline?: map[string]any(name='SceneBaseline', example='{"avgRt":1,"avgTps":1,"failCountBiz":1,"failCountReq":1,"seg90Rt":1,"seg99Rt":2,"successRateBiz":0.5,"successRateReq":1}'),
  sceneId?: string(name='SceneId', example='NB54CV'),
}

model UpdatePtsSceneBaseLineShrinkRequest {
  apiBaselinesShrink?: string(name='ApiBaselines', example='[{"avgRt":1,"avgTps":1,"failCountBiz":1,"failCountReq":182381,"id":362447,"maxRt":3051,"minRt":0,"name":"1-1","seg50Rt":1,"seg75Rt":1,"seg90Rt":1,"seg99Rt":3,"successRateBiz":1,"successRateReq":0,"timingConnAvg":0},{"avgRt":1.06,"avgTps":1,"failCountBiz":0,"failCountReq":151143,"id":362446,"maxRt":3068,"minRt":0,"name":"dd","seg50Rt":1,"seg75Rt":1,"seg90Rt":1,"seg99Rt":2,"successRateBiz":1,"successRateReq":0}]'),
  sceneBaselineShrink?: string(name='SceneBaseline', example='{"avgRt":1,"avgTps":1,"failCountBiz":1,"failCountReq":1,"seg90Rt":1,"seg99Rt":2,"successRateBiz":0.5,"successRateReq":1}'),
  sceneId?: string(name='SceneId', example='NB54CV'),
}

model UpdatePtsSceneBaseLineResponseBody = {
  code?: string(name='Code', example='200'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4F7D2CE0-AE4C-4143-955A-8E4595AF86A6'),
  success?: boolean(name='Success', example='true'),
}

model UpdatePtsSceneBaseLineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePtsSceneBaseLineResponseBody(name='body'),
}

async function updatePtsSceneBaseLineWithOptions(tmpReq: UpdatePtsSceneBaseLineRequest, runtime: Util.RuntimeOptions): UpdatePtsSceneBaseLineResponse {
  Util.validateModel(tmpReq);
  var request = new UpdatePtsSceneBaseLineShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.apiBaselines)) {
    request.apiBaselinesShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.apiBaselines, 'ApiBaselines', 'json');
  }
  if (!Util.isUnset(tmpReq.sceneBaseline)) {
    request.sceneBaselineShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.sceneBaseline, 'SceneBaseline', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.apiBaselinesShrink)) {
    query['ApiBaselines'] = request.apiBaselinesShrink;
  }
  if (!Util.isUnset(request.sceneBaselineShrink)) {
    query['SceneBaseline'] = request.sceneBaselineShrink;
  }
  if (!Util.isUnset(request.sceneId)) {
    query['SceneId'] = request.sceneId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpdatePtsSceneBaseLine',
    version = '2020-10-20',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updatePtsSceneBaseLine(request: UpdatePtsSceneBaseLineRequest): UpdatePtsSceneBaseLineResponse {
  var runtime = new Util.RuntimeOptions{};
  return updatePtsSceneBaseLineWithOptions(request, runtime);
}

